package net.cnki.sunny.model.enums;

public class OperateLogEnums {

    public enum OperateType {

        OPERATE_LOGIN(1, "登录"),
        OPERATE_BROWSE(2, "浏览"),
        OPERATE_SEARCH(3, "检索");

        private Integer code;
        private String name;

        public Integer getCode() {
            return this.code;
        }

        public String getName() {
            return this.name;
        }

        OperateType(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public OperateType getByCode(Integer code) {
            for (OperateType operateType : OperateType.values()) {
                if (operateType.code.equals(code)) {
                    return operateType;
                }
            }
            return null;
        }

    }
}
